package com.pv.bfc.web.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.pv.bfc.model.BriefcaseUser;

public class ForgotUsernameValidator implements Validator {
	@SuppressWarnings("unchecked")
	public boolean supports(Class clazz) {
		return BriefcaseUser.class.isAssignableFrom(clazz);
	}

	public void validate(Object obj, Errors errors) {

		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "email",
				"error.required.user.email");
	}
}
